<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>vue指令4(v-on的补充)</title>
    <script src="node_modules/vue/dist/vue.js"></script>
</head>
<body>
<div id="app">
    <h1>{{name}}</h1>
    <input type="button" value="点我点我" @click="doit('牛逼牛逼',222)">
    <input type="text" @keyup.enter="sayhi">
</div>

<script type="text/javascript">
    var app = new Vue({
        el:"#app",
        data:{
            name:"这是一个用npm方式搭建的工程",
        },
        methods:{
            doit:function (p1,p2) {
                console.log("写死的参数，后面为传入的参数");
                console.log(p1);
                console.log("传入的数值为"+p2);
            },
            sayhi:function () {
              alert("当你按下enter会有提示");
            }
        }
    });
</script>
</body>
</html>